package com.cfpl.project_common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 果蔬管理表
 * @TableName vegetable_management
 */
@TableName(value ="vegetable_management")
@Data
public class VegetableManagement implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 果蔬名称,fk
     */
    private Long vegetableId;

    /**
     * 种类，水果or蔬菜
     */
    private String classification;

    /**
     * 种植户社会信用代码,fk
     */
    private Long growerInformation;

    /**
     * 种植开始日期
     */
    private Date plantingStartDate;

    /**
     * 生长周期，天
     */
    private Integer growthPeriod;

    /**
     * 收获日期=开始日期+生长周期
     */
    private Date harvestDate;

    /**
     * 是否删除(0-未删, 1-已删)
     */
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        VegetableManagement other = (VegetableManagement) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getVegetableId() == null ? other.getVegetableId() == null : this.getVegetableId().equals(other.getVegetableId()))
            && (this.getClassification() == null ? other.getClassification() == null : this.getClassification().equals(other.getClassification()))
            && (this.getGrowerInformation() == null ? other.getGrowerInformation() == null : this.getGrowerInformation().equals(other.getGrowerInformation()))
            && (this.getPlantingStartDate() == null ? other.getPlantingStartDate() == null : this.getPlantingStartDate().equals(other.getPlantingStartDate()))
            && (this.getGrowthPeriod() == null ? other.getGrowthPeriod() == null : this.getGrowthPeriod().equals(other.getGrowthPeriod()))
            && (this.getHarvestDate() == null ? other.getHarvestDate() == null : this.getHarvestDate().equals(other.getHarvestDate())) && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getVegetableId() == null) ? 0 : getVegetableId().hashCode());
        result = prime * result + ((getClassification() == null) ? 0 : getClassification().hashCode());
        result = prime * result + ((getGrowerInformation() == null) ? 0 : getGrowerInformation().hashCode());
        result = prime * result + ((getPlantingStartDate() == null) ? 0 : getPlantingStartDate().hashCode());
        result = prime * result + ((getGrowthPeriod() == null) ? 0 : getGrowthPeriod().hashCode());
        result = prime * result + ((getHarvestDate() == null) ? 0 : getHarvestDate().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", vegetableId=").append(vegetableId);
        sb.append(", classification=").append(classification);
        sb.append(", growerInformation=").append(growerInformation);
        sb.append(", plantingStartDate=").append(plantingStartDate);
        sb.append(", growthPeriod=").append(growthPeriod);
        sb.append(", harvestDate=").append(harvestDate);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}